package com.pcbly.web.components.utils.converters;

import org.apache.commons.beanutils.Converter;
import org.apache.commons.beanutils.converters.DoubleConverter;

public class MyDoubleConverter implements Converter {

	private static Double newDouble()
    {
        return new Double(0.0D);
    }
	@SuppressWarnings("unchecked")
    public Object convert(Class type, Object value)
    {
        if(type.equals(Double.TYPE) && value == null)
            return newDouble();
        else
            return (new DoubleConverter()).convert(type, value);
    }
    public MyDoubleConverter(){
    	
    }

}
